<?php

include_once "db.php";

class Project
{
    private $project_id;
    private $project_name;
    private $description;
    private $chapter_id;

    private $projectfound;

    public function __construct($id)
    {
        global $mysqli;
        $query = "SELECT * FROM Projects WHERE ProjectId = '" . $id . "'";
        $data = $mysqli->query($query);
        if ($data->num_rows != 0)
        {
            $row = $data->fetch_array(MYSQLI_ASSOC);
            $this->project_id = intval($row["ProjectId"]);
            $this->event_name = $row["Name"];
            $this->description = $row["Description"];
            $this->chapter_id = $row["ChapterId"];
            $eventfound = true;
        } else
        {
            $this->regionfound = false;
        }
    }

    public function getProjectId()
    {
        return $this->project_id;
    }

    public function getProjectName()
    {
        return $this->project_name;
    }

    public function getDescription()
    {
        return $this->description;
    }

    public function getChapterId()
    {
        return $this->chapter_id;
    }

    public function projectFound()
    {
        return $this->project_found;
    }
}

?>